package bankapp;

import frmsystem.Entry;
import frmsystem.IAccount;


public class Withdraw extends Entry{
	
	public Withdraw(IAccount account) {
		super(account);
	}
	
	public void execute(){
		double prevbalance = this.account.getBalance();
		double newbalance = prevbalance - this.getAmount();
		this.account.setBalance(newbalance);			
	}
	
	public String toString(){
		return "Withdraw : $ " + String.valueOf(amount) + " , " + date.toString();		
	}

}
